
package com.kl.bean;

import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
    "province",
    "city",
    "county",
    "detail"
})
public class Address {

    /**
     * 省
     * <p>
     * 
     * 
     */
    @JsonProperty("province")
    private Address.Province province;
    /**
     * 市
     * <p>
     * 
     * 
     */
    @JsonProperty("city")
    private Address.City city;
    /**
     * 县/区
     * <p>
     * 
     * 
     */
    @JsonProperty("county")
    private Address.County county;
    /**
     * 详细地址
     * <p>
     * 
     * 
     */
    @JsonProperty("detail")
    private String detail;
    @JsonIgnore
    private Map<String, Object> additionalProperties = new HashMap<String, Object>();

    /**
     * 省
     * <p>
     * 
     * 
     */
    @JsonProperty("province")
    public Address.Province getProvince() {
        return province;
    }

    /**
     * 省
     * <p>
     * 
     * 
     */
    @JsonProperty("province")
    public void setProvince(Address.Province province) {
        this.province = province;
    }

    public Address withProvince(Address.Province province) {
        this.province = province;
        return this;
    }

    /**
     * 市
     * <p>
     * 
     * 
     */
    @JsonProperty("city")
    public Address.City getCity() {
        return city;
    }

    /**
     * 市
     * <p>
     * 
     * 
     */
    @JsonProperty("city")
    public void setCity(Address.City city) {
        this.city = city;
    }

    public Address withCity(Address.City city) {
        this.city = city;
        return this;
    }

    /**
     * 县/区
     * <p>
     * 
     * 
     */
    @JsonProperty("county")
    public Address.County getCounty() {
        return county;
    }

    /**
     * 县/区
     * <p>
     * 
     * 
     */
    @JsonProperty("county")
    public void setCounty(Address.County county) {
        this.county = county;
    }

    public Address withCounty(Address.County county) {
        this.county = county;
        return this;
    }

    /**
     * 详细地址
     * <p>
     * 
     * 
     */
    @JsonProperty("detail")
    public String getDetail() {
        return detail;
    }

    /**
     * 详细地址
     * <p>
     * 
     * 
     */
    @JsonProperty("detail")
    public void setDetail(String detail) {
        this.detail = detail;
    }

    public Address withDetail(String detail) {
        this.detail = detail;
        return this;
    }

    @JsonAnyGetter
    public Map<String, Object> getAdditionalProperties() {
        return this.additionalProperties;
    }

    @JsonAnySetter
    public void setAdditionalProperty(String name, Object value) {
        this.additionalProperties.put(name, value);
    }

    public Address withAdditionalProperty(String name, Object value) {
        this.additionalProperties.put(name, value);
        return this;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(Address.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
        sb.append("province");
        sb.append('=');
        sb.append(((this.province == null)?"<null>":this.province));
        sb.append(',');
        sb.append("city");
        sb.append('=');
        sb.append(((this.city == null)?"<null>":this.city));
        sb.append(',');
        sb.append("county");
        sb.append('=');
        sb.append(((this.county == null)?"<null>":this.county));
        sb.append(',');
        sb.append("detail");
        sb.append('=');
        sb.append(((this.detail == null)?"<null>":this.detail));
        sb.append(',');
        sb.append("additionalProperties");
        sb.append('=');
        sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
        sb.append(',');
        if (sb.charAt((sb.length()- 1)) == ',') {
            sb.setCharAt((sb.length()- 1), ']');
        } else {
            sb.append(']');
        }
        return sb.toString();
    }

    @Override
    public int hashCode() {
        int result = 1;
        result = ((result* 31)+((this.county == null)? 0 :this.county.hashCode()));
        result = ((result* 31)+((this.detail == null)? 0 :this.detail.hashCode()));
        result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
        result = ((result* 31)+((this.province == null)? 0 :this.province.hashCode()));
        result = ((result* 31)+((this.city == null)? 0 :this.city.hashCode()));
        return result;
    }

    @Override
    public boolean equals(Object other) {
        if (other == this) {
            return true;
        }
        if ((other instanceof Address) == false) {
            return false;
        }
        Address rhs = ((Address) other);
        return ((((((this.county == rhs.county)||((this.county!= null)&&this.county.equals(rhs.county)))&&((this.detail == rhs.detail)||((this.detail!= null)&&this.detail.equals(rhs.detail))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.province == rhs.province)||((this.province!= null)&&this.province.equals(rhs.province))))&&((this.city == rhs.city)||((this.city!= null)&&this.city.equals(rhs.city))));
    }


    /**
     * 市
     * <p>
     * 
     * 
     */
    public enum City {

        __EMPTY__("\u91cd\u5e86\u5e02");
        private final String value;
        private final static Map<String, Address.City> CONSTANTS = new HashMap<String, Address.City>();

        static {
            for (Address.City c: values()) {
                CONSTANTS.put(c.value, c);
            }
        }

        private City(String value) {
            this.value = value;
        }

        @Override
        public String toString() {
            return this.value;
        }

        @JsonValue
        public String value() {
            return this.value;
        }

        @JsonCreator
        public static Address.City fromValue(String value) {
            Address.City constant = CONSTANTS.get(value);
            if (constant == null) {
                throw new IllegalArgumentException(value);
            } else {
                return constant;
            }
        }

    }


    /**
     * 县/区
     * <p>
     * 
     * 
     */
    public enum County {

        __EMPTY__("\u6e1d\u5317\u533a");
        private final String value;
        private final static Map<String, Address.County> CONSTANTS = new HashMap<String, Address.County>();

        static {
            for (Address.County c: values()) {
                CONSTANTS.put(c.value, c);
            }
        }

        private County(String value) {
            this.value = value;
        }

        @Override
        public String toString() {
            return this.value;
        }

        @JsonValue
        public String value() {
            return this.value;
        }

        @JsonCreator
        public static Address.County fromValue(String value) {
            Address.County constant = CONSTANTS.get(value);
            if (constant == null) {
                throw new IllegalArgumentException(value);
            } else {
                return constant;
            }
        }

    }


    /**
     * 省
     * <p>
     * 
     * 
     */
    public enum Province {

        __EMPTY__("\u91cd\u5e86\u5e02");
        private final String value;
        private final static Map<String, Address.Province> CONSTANTS = new HashMap<String, Address.Province>();

        static {
            for (Address.Province c: values()) {
                CONSTANTS.put(c.value, c);
            }
        }

        private Province(String value) {
            this.value = value;
        }

        @Override
        public String toString() {
            return this.value;
        }

        @JsonValue
        public String value() {
            return this.value;
        }

        @JsonCreator
        public static Address.Province fromValue(String value) {
            Address.Province constant = CONSTANTS.get(value);
            if (constant == null) {
                throw new IllegalArgumentException(value);
            } else {
                return constant;
            }
        }

    }

}
